package com.liveinstars.activity.business.activity.repository.persistence;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.liveinstars.activity.business.activity.repository.po.Question;
import com.liveinstars.activity.business.activity.repository.mapper.QuestionMapper;
import com.liveinstars.activity.business.activity.repository.facade.IQuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课件问题和申请加入问题表 服务实现类
 * </p>
 *
 * @author ting
 * @since 2020-08-24
 */
@Service
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements IQuestionService {

    @Override
    public List<Question> getQuestions(Integer activityId) {
        QueryWrapper<Question> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("activity_id", activityId);
        queryWrapper.eq("for_approve", 1);
        return this.list(queryWrapper);
    }
}
